package pfsimulator;

/**
 * Created with IntelliJ IDEA.
 * User: codefish
 * Date: 11/2/12
 * Time: 3:28 PM
 * To change this template use File | Settings | File Templates.
 */
public class Flow {
    private long flowid;
    private VNode src;
    private VNode dst;
    private long bwShare;
    private long flowSize;

    // Constructor for throttle instruction
    public Flow(long flowid, VNode src, VNode dst, long bwShare) {
        this.flowid = flowid;
        this.src = src;
        this.dst = dst;
        this.bwShare = bwShare;
    }

    // Complete constructor for init flow
    public Flow(long flowid, VNode src, VNode dst, long bwShare, long flowSize) {
        this.flowid = flowid;
        this.src = src;
        this.dst = dst;
        this.bwShare = bwShare;
        this.flowSize = flowSize;
    }

    // Getters & Setters
    public long getFlowid() {
        return flowid;
    }

    public void setFlowid(long flowid) {
        this.flowid = flowid;
    }

    public VNode getSrc() {
        return src;
    }

    public void setSrc(VNode src) {
        this.src = src;
    }

    public VNode getDst() {
        return dst;
    }

    public void setDst(VNode dst) {
        this.dst = dst;
    }

    public long getBwShare() {
        return bwShare;
    }

    public void setBwShare(long bwShare) {
        this.bwShare = bwShare;
    }

    public long getFlowSize() {
        return flowSize;
    }

    public void setFlowSize(long flowSize) {
        this.flowSize = flowSize;
    }

    //
    // APIs
    //

    public String getSrcHostname(){
        return src.getHostName();
    }

    public String getDstHostname(){
        return dst.getHostName();
    }

}
